﻿<%@ WebHandler Language="C#" Class="caselist_handler" %>

using System;
using System.Web;
using System.Data;
using System.Collections;
using System.Web.SessionState;
using IBM.Data.DB2;


public class caselist_handler : IHttpHandler, IRequiresSessionState 
    {
       

        public void ProcessRequest(HttpContext context)
        {
           context. Response.Buffer = false;
           context.Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1);
           context.Response.Expires = 0;
           context.Response.CacheControl = "no-cache";  

            System.Diagnostics.Debug.WriteLine("ProcessRequest: "+DateTime.Now.ToString("ss;fff"));
            context.Response.ContentType = "text/plain";
            context.Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
            string webpagename = context.Request.QueryString["webpagename"];

           
            if (webpagename != null)
            {
                string json="";

                PaginationDataLister lister = new PaginationDataLister(webpagename,context.Request,context.Session );

                if (webpagename == "zhtjfx")
                {
                    Zhtjfx aa = lister.dataList as Zhtjfx;
                    int countx = lister.dataList.GetTotalCount();
                    context.Session.Add("zhtjfx_tqdb_count", string.Format("共有案件：{0}件，去年同期：{1}件", countx, aa.GetTQDB_TotalCount()));
                    context.Session.Add("zhtjfx_count", string.Format("共有案件：{0}件", countx));
                }
 
                json = lister.GetEasyUIDataGridJson();
               System.Diagnostics.Debug.WriteLine("return data: " + DateTime.Now.ToString("ss;fff"));
               context.Response.Write(json);
               context.Response.End();
            
            }
            else
            {
                context.Response.Write("0");
                context.Response.End();
            }


        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

       

    }

